#ifndef __ES_TIM_H
#define __ES_TIM_H

#ifdef __cplusplus
 extern "C" {
#endif

#include "stm32f10x_tim.h"


void tim_init(TIM_TypeDef* TIMx, uint16_t psc, uint16_t arr, uint8_t Preemp, uint8_t Sub);
void pwm_init(TIM_TypeDef* TIMx, uint16_t psc, uint16_t arr, uint16_t pulse, uint8_t using_ch);
void set_pulse(TIM_TypeDef *TIMx, uint8_t channel, uint16_t pulse);

#ifdef __cplusplus
}
#endif

#endif /* __ES_TIM_H */
